package com.myzl.web.controller.coal;

import com.myzl.coal.service.IStatisticsService;
import com.myzl.common.core.controller.BaseController;
import com.myzl.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 设备表Controller
 *
 * @author myzl
 * @date 2022-09-01
 */
@RestController
@RequestMapping("/coal/daily")
public class DailyController extends BaseController
{
    @Autowired
    private IStatisticsService statisticsService;

    /**
     * 查询皮带秤统计数据
     */
    @PreAuthorize("@ss.hasPermi('coal:daily:list')")
    @GetMapping("/list/{date}")
    public AjaxResult list(@PathVariable("date") String date)
    {
        AjaxResult result = statisticsService.daily(date);
        return result;
    }

    /**
     * 查询皮带秤统计数据
     */
    @PreAuthorize("@ss.hasPermi('coal:daily:list')")
    @GetMapping("/list/{date}/{deviceId}")
    public AjaxResult listByDeviceId(@PathVariable("date") String date,@PathVariable("deviceId") Integer deviceId)
    {
        AjaxResult result = statisticsService.daily(date,deviceId);
        return result;
    }
}
